\(\int \frac {\csc ^2(x)}{i+\cot (x)} \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 9 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-i x+\log (\sin (x)) \]

[Out]

-I*x+ln(sin(x))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3568, 31} \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=\log (\sin (x))-i x \]

[In]

Int[Csc[x]^2/(I + Cot[x]),x]

[Out]

(-I)*x + Log[Sin[x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{i+x} \, dx,x,\cot (x)\right ) \\ & = -i x+\log (\sin (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.33 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-i x+\log (\cos (x))+\log (\tan (x)) \]

[In]

Integrate[Csc[x]^2/(I + Cot[x]),x]

[Out]

(-I)*x + Log[Cos[x]] + Log[Tan[x]]

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00

method result size
derivativedivides \(-\ln \left (i+\cot \left (x \right )\right )\) \(9\)
default \(-\ln \left (i+\cot \left (x \right )\right )\) \(9\)
risch \(-2 i x +\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(14\)

[In]

int(csc(x)^2/(I+cot(x)),x,method=_RETURNVERBOSE)

[Out]

-ln(I+cot(x))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.22 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-2 i \, x + \log \left (e^{\left (2 i \, x\right )} - 1\right ) \]

[In]

integrate(csc(x)^2/(I+cot(x)),x, algorithm="fricas")

[Out]

-2*I*x + log(e^(2*I*x) - 1)

Sympy [A] (verification not implemented)

Time = 2.58 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.78 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=- \log {\left (\cot {\left (x \right )} + i \right )} \]

[In]

integrate(csc(x)**2/(I+cot(x)),x)

[Out]

-log(cot(x) + I)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.78 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-\log \left (\cot \left (x\right ) + i\right ) \]

[In]

integrate(csc(x)^2/(I+cot(x)),x, algorithm="maxima")

[Out]

-log(cot(x) + I)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (7) = 14\).

Time = 0.27 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.67 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-2 \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - i\right ) + \log \left (\tan \left (\frac {1}{2} \, x\right )\right ) \]

[In]

integrate(csc(x)^2/(I+cot(x)),x, algorithm="giac")

[Out]

-2*log(tan(1/2*x) - I) + log(tan(1/2*x))

Mupad [B] (verification not implemented)

Time = 12.63 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.22 \[ \int \frac {\csc ^2(x)}{i+\cot (x)} \, dx=-\mathrm {atan}\left (2\,\mathrm {tan}\left (x\right )-\mathrm {i}\right )\,2{}\mathrm {i} \]

[In]

int(1/(sin(x)^2*(cot(x) + 1i)),x)

[Out]

-atan(2*tan(x) - 1i)*2i